<legend>Chọn thông tin lọc cho sản phẩm</legend>
<?php
if(isset($this->product)){
	$arrFilterValues = Helper_Model::GetColumnsValues('product_filtervalue', 'filtervalue_id', 'product_id='. $this->product->id);
}
if(isset($this->arrFilters) && count($this->arrFilters) > 0){
	foreach($this->arrFilters as $filter){
?>
	<div class="row">
			<label><?php echo $filter->name;?></label>
			<select name="filter[]"">
				<option value="0">Chọn <?php echo $filter->name;?></option>
				<?php
				foreach ($filter->findDependentRowset('Model_FilterValue') as $filterValue){
					
						if(in_array($filterValue->id, $arrFilterValues)){
							echo "<option selected = 'selected' value='". $filterValue->id. "'>". $filterValue->text. "</option>";
						}else{
							echo "<option value='". $filterValue->id. "'>". $filterValue->text. "</option>";
						}
					
				} 
				?>
			</select>
		</div>
		
<?php		
	}
}
?>
